Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a function to get nCells/nNodes #31

Merged
merged 2 commits into from
Apr 14, 2021
Merged

Conversation

akleb
Copy link
Contributor

@akleb akleb commented Apr 14, 2021

Purpose

Adds a function that returns the total number of cells and nodes in a grid.

Type of change

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (non-backwards-compatible fix or feature)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Documentation update
  • Maintenance update
  • Other (please describe)

Testing

I am not sure what our unit testing procedure is, but I can write one if necessary.

Checklist

  • I have run flake8 and black to make sure the code adheres to PEP-8 and is consistently formatted
  • I have run unit and regression tests which pass locally with my changes
  • I have added new tests that prove my fix is effective or that my feature works
  • I have added necessary documentation

@akleb akleb requested a review from a team as a code owner April 14, 2021 04:06
Copy link
Contributor

@marcomangano marcomangano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice addition, looks good. Just two things:

  1. Please run black/flake8 to ensure there are no linting errors and all tests pass
  2. Can you add a one-line example of how to call this function from a script? You can add it to the method docstring.
    Thanks!

Copy link
Collaborator

@ewu63 ewu63 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to also make the wall boundary cells/nodes part a separate function for consistency? There are no tests right now, but if you are familiar with unittest it'd be good to start some.

Copy link
Contributor

@eirikurj eirikurj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just a couple of minor suggestions.
As @nwu63 mentioned, it would also be great if we can get some unittests started.

def printInfo(self):
"""Print some information on the mesh to screen. Specifically
information needed by the drag prediction workshop"""
def getCellsNodes(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use a more descriptive function name like getTotalCellsAndNodes?


def printInfo(self):
"""Print some information on the mesh to screen. Specifically
information needed by the drag prediction workshop"""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is being updated, please update the docstring with more relevant text.

@ewu63
Copy link
Collaborator

ewu63 commented Apr 14, 2021

@akleb I reverted your commits and manually reapplied it, since black changed a bunch of lines unnecessarily. Please check and make sure I didn't miss anything.

@akleb
Copy link
Contributor Author

akleb commented Apr 14, 2021

@nwu63 yes, that looks like everything

@eirikurj eirikurj merged commit c77d62c into mdolab:master Apr 14, 2021
@akleb akleb deleted the get-nCells branch March 16, 2022 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants